//data.h data formatting info for the Fonera
#include "ConfigFileStruct.h"

//byte length of data types
#define time_bytes 	2  //real time clock from microcontroller
#define GPS_bytes 	32  //#bytes in a GPS string
#define vel_bytes 	2   //velocity int
#define acc_bytes 	6   //accelerometer int x,y,z
#define acc_x_bytes 2
#define acc_y_bytes	2
#define acc_z_bytes 2
#define brake_bytes 1 //braking 1=yes, 2=no
#define gear_bytes  1 //0=neutral
#define rpm_bytes 	2
#define command_bytes 1

#define rpm_tag 	'r'
#define time_tag 	't' 
#define GPS_tag 	'g'  
#define vel_tag 	'v'  
#define acc_tag 	'a'  
#define brake_tag 	'b'
#define gear_tag 	'e'
#define command_tag 'c' //for commands to fonera from 6812

void write_header(int file_fd, configFileType* cfg_file);

void read_write_serial_data(int file_fd, int console_int);

// struct
// data
// {
// int time_stamp;
// char type;//v=velocity, r=rpm, b=breaking, g=gps, x=acceleration x-directed,y=acceleration y-directed,z=acceleration z-directed,
// int data;
// char GPS[GPS_bytes];//inefficient but easy. probably not a problem if the struct is only around for a short time
// };

// struct
// data_string
// {
// char type;
// char time_stamp[time_bytes];
// char data[GPS_bytes];//null terminated string of data,GPS will be the longest data string
// };

